function [rp,tp,rs,ts]=f_rtamp(n1,k1,n2,k2,fi1,fi2) 
%calculate amplitude of transmission and reflection 
%Written by Feiran Huang on 05/31/99. Last Update 05/31/99 
%------------------------- 
%given index and absorption  
n1=n1-i*k1; 
n2=n2-i*k2;  

rp=(n1*cos(fi2)-n2*cos(fi1))/(n1*cos(fi2)+n2*cos(fi1)); 
rs=(n1*cos(fi1)-n2*cos(fi2))/(n1*cos(fi1)+n2*cos(fi2)); 
tp=2*n1*cos(fi1)/(n1*cos(fi2)+n2*cos(fi1)); 
ts=2*n1*cos(fi1)/(n1*cos(fi1)+n2*cos(fi2)); 